package com.lebang.controller.api.member;

import com.lebang.common.util.RequestUtil;
import com.lebang.entity.RequestHeaders;
import com.lebang.service.buss.MemberService;
import com.lebangweb.response.Callback;
import com.lebangweb.response.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: hwq
 * @Date: 2020/11/18 16:04
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/member/reward")
public class RewardApi {
       @Autowired
       private MemberService memberService;
    @PostMapping("/check")
    public JsonData check(HttpServletRequest request) {
        //提取头部数据
        RequestHeaders requestHeaders = RequestUtil.getHeader(request);
        return Callback.success("success", "查询成功",   memberService.checkReward(requestHeaders.getUserid()));
    }
}
